home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / Snippets / !SnippetIndex (tab-delimited) < prev   
Encoding:
Text File  |  1995-09-20  |  43.0 KB  |  252 lines  |  [TEXT/????]

  1. Create AOCE Business Card    Shows how to create a PowerTalk business card anywhere on a given volume. Just create an FSSpec and call CreateBusinessCard() with that FSSpec.     AOCE
  2. DragBusinessCard    This program shows how to accept drags of flavorTypeDirectory and flavorTypeHFS for a PowerTalk business card, and drags from the application to the Finder to create generic clippings that contain an empty packedDSSpec structure.    AOCE
  3. FindSerialPorts    This is a little snippet from the "Inside the Macintosh Communications Toolbox" which demonstrates the correct method for detecting which serial ports are present.    Communications Toolbox
  4. Get Tool Config    This sample shows how to accumulate into a TEXT file the config strings of Connection Tools that have been configured with CMChoose.    Communications Toolbox
  5. AEGestalt    AEGestalt is a MacApp application which shows how to make use of the built in Apple events support.     Development Tools & Languages
  6. Bits o' MacApp Code    A few MacApp snippets: Windows Menu, a view that stays centered in its superview,  TTextListView, TTextGridView, a Light Gray Adorner, and more.     Development Tools & Languages
  7. Dialogs    This MacApp sample shows how TextEdit views are enabled/disabled, in this case with radio buttons.    Development Tools & Languages
  8. DTSCPlusLibrary    This folder is chock full of useful C++ samples (80+ files!), including a complete  framework for writing small applications.    Development Tools & Languages
  9. DumpSRec    This MPW tool converts an arbitrary Macintosh data file or resource into Motorola S-Record format, mostly to assist in downloading code and data to EPROM programmers or non-Macintosh target platforms.    Development Tools & Languages
  10. Eenie    Eenie - example MacApp program showing how to use the Dependency mechanism and Adorners. Also shows how to use the new View format with defining customized cursors over views.    Development Tools & Languages
  11. LockFile    Demonstrates setting the file lock bit in an action atom for the installer.  This action atom code resource must be called through a post installation action atom.  In the selector field, pass in the name of the target 'infs'  resource id.    Development Tools & Languages
  12. Low Level Debugger macros    Debugger macros for MacApp 3.0.     Development Tools & Languages
  13. MacApp C++ Load/dump    Two MPW scripts that show a couple ways to use load/dump in MAMake files.    Development Tools & Languages
  14. MouseInfo    This sample shows how to make use of MacApp 3.0 Behaviors, how to create them, how behaviors could control window information, track events, and also spawn off other behaviors.     Development Tools & Languages
  15. PICTDialog    This MacApp sample shows how easy it is to include PICT resources in modal dialogs.    Development Tools & Languages
  16. RemoveVMSVersionNumbers    This MPW script removes VMS style version number extensions from file  names.    Development Tools & Languages
  17. ScreenShots from MacsBug    It is possible to take a screen shot while in MacsBug  by adding this function to your program.  You can jump directly to this function from anywhere in your program using MacsBug commands, take a screen shot, and then continue with normal program execution.     Development Tools & Languages
  18. Shared Lib. Mgr. C++    This snippet shows how to turn a generic C++ class (not Pascal/Handle object based) into a Shared Library class. The Makefile is a suitable template for similar work.    Development Tools & Languages
  19. ShowBalloon XFCN    This XFCN allows you to use Balloon Help in conjunction with HyperCard. The source code and the demo stack will get you going.    Development Tools & Languages
  20. UserFunction Gestalt    This snippet is for Installer scripters.  The UserChkGestaltFunction provides an alternative to the CheckGestalt clause which requires that the scripter provide all possible matches to the results of the Gestalt call.  With the User Function, the script writer can simply check for the existence of a gestalt selector, without having to worry about it's return values.    Development Tools & Languages
  21. Windoid    Windoid is a MacApp 3.0 sample, which shows how to construct tear-off floating windows.    Development Tools & Languages
  22. Audio CD    An MPW Tool that allows you to start, stop, pause, and continue audio CD tracks.    Devices
  23. CD Tracker    Pascal snippet that gets info on Audio CD tracks    Devices
  24. CDROMDriveCheck    An MPW C tool that checks to see which SCSI IDs are AppleCD SC drives.  It makes a status call(97) to the AppleCD SC driver (only works with this driver).    Devices
  25. CDTool    An MPW Tool that controls a CD drive    Devices
  26. DisableEject    Shows how to stop a floppy disk from being ejected. This has no chance of being compatible with future system software.    Devices
  27. Disk Icons    This C routine calls disk drivers to retrieve icon information.    Devices
  28. EgretWakeup    This is a test program to tell a Mac with an Egret (or Egret derivative) chip when to power up.  It does so by calling the _Egret trap. If the Power Manager exists, use the SetWUTime call as per Inside Macintosh, Power  Manager chapter (Vol VI). This program only works on a Egret-based Macs that ALSO can do soft power.  For example while the IIsi and LC CPUs both have Egrets, LCs can't do soft power on).     Devices
  29. Floppy II    This sample uses the sony driver calls to get the format list of a super drive disk, to find if the disk supports MFM 720 disk. If so, it reformats the disk to be that type. !! Warning: The data on the disk in drive 1  will get blown away and there are no warnings.!!    Devices
  30. ledApp    This is a faceless background task for System 7. It counts to 7 on an extended keyboard’s lights repeatedly until the Shift and Caps Lock keys are pressed, or until it receives a Quit Application Apple event.    Devices
  31. PackMan C    This snippet shows how to implement a simple Chooser Package in C, based on Scott “Zz” Zimmerman's  PACKman pascal sample    Devices
  32. PBxxx Serial Demo    Shows how to use the serial ports correctly.  Connect your macs up with a serial cable if you want to see it in action.  Or just look at the code to see how things ought to be done.    Devices
  33. Play    With this program on your hard disk; you can double click on a track on an Audio CD and the CD SC drive will start playing the audio track and will continue until the end of the disk    Devices
  34. ReadSector MSDOS    This snippet shows how to read and write physical sectors on MS-DOS floppies within your application (as Apple File Exchange does), rather than writing an external file system.    Devices
  35. SCSI Inquiry    This MPW tool shows how to make a SCSI inquiry command to an HD80SC.    Devices
  36. SCSI Simple Sample    A simple sample that can deal with both the old and new SCSI Managers.    Devices
  37. Serial Driver Arbitration    This is an example of how to correctly arbitrate the serial ports.  It's taken from tech note DV 11 - Opening the Serial Ports.    Devices
  38. SlotVInstall    This little program installs a slot VBL task for the main screen, even if the main screen uses built-in video, by getting the gdRefNum and calling GetDctlEntry to find the slot number.    Devices
  39. Wake100    Wake100 resets the wake up time on PowerBooks that support it (PB 100, Portable) so that it wakes up at the same time everyday.    Devices
  40. AsyncPB    AsyncPB is an example of how File System calls can be made in a chain from an interrupt handler like the Time Manager.     Files
  41. DeleteDirectory    This C routine will delete a subdirectory from a Macintosh volume, including any nested directories. It works in AppleShare as well as normal environments.    Files
  42. deleteEmptyDir    These MPW tools identify and/or delete all empty folders on a specified volume using PBCatSearch.    Files
  43. ficycle    This THINK Pascal™ program lists the files contained in a folder.    Files
  44. GetFInfo & GetVInfo    MPW Tools that simply parse command-line options and print the value of the parameter blocks returned from Toolbox calls.    Files
  45. GetOwnerGroup     Shows how to get the owner and group of a directory using routines from MoreFiles.    Files
  46. Keith's CatSearch    This snippet provides a high-level interface to PBCatSearch and allows you to limit the search to a specific subdirectory (after the fact, of course - see the read me for the details).    Files
  47. ParseFullPathname    ParseFullPathname takes a full pathname (which can be longer than 255 chars, and walks down it, converting it to dirID's along the way. This is the opposite of the procedure described in TN #68 (more or less). DTS does not condone this.    Files
  48. PBCatSearch    This small sample shows how to use the PBCatSearch function. It presents a dialog where you can enter any Creator and File Type, then it searches for one (1) file with that creator and type. When it finds it, it will show you the file name.    Files
  49. PBDTGetAppl    This snippet shows how to access the desktop database to get information about an application based on its creator.  See the code in SlimFunctions.c for how to make the calls.    Files
  50. resolveRelativeAlias    resolveRelativeAlias is an MPW tool which demonstrates use of a relative alias for locating a file in a known folder on an unknown volume.    Files
  51. Select Folder w/ Gray files    This is an example of twisted abuse of user interface in order to achieve a noble purpose: as better "Select Folder" example that shows the files in the folder grayed out.     Files
  52. SettingUpStdFile    This snippet demonstrates how to make Standard File select an initial file under both System 6 and System 7.     Files
  53. SFGetFolder C    This sample uses the new System 7 CustomGetFile routine to provide a StandardGetFolder call to be used by applications when the user needs to select a folder instead of a file. C Version.    Files
  54. SFGetFolder Pascal    This sample uses the new System 7 CustomGetFile routine to provide a StandardGetFolder call to be used by applications when the user needs to select a folder instead of a file. Pascal Version.    Files
  55. stdFilterHacking    The new Standard Dialog Filter in 7.0 and later has a problem: if you dim a button and then your dialog gets an activate event,  the button will be re-enabled! Here's some code to fix the problem.    Files
  56. TimerTst    This hardware-dependent snippet shows how to use the VIA timers (for the few times when the Time Manager is not appropriate).    Hardware
  57. VBL Snippet    A simple example of a persistent VBL written in C that works with 68K or PowerPC.    Hardware
  58. AE Interaction Sample    Two small applications, Sender and Receiver, show what interaction levels mean to the Apple Event Manager.    Interapplication Communication
  59. AECDEV/AEDEAMON    This sample is designed to answer that age-old question; "How do I send AppleEvents from a DA/CDEV/INIT/Driver?" Read the read_me to find the answer <grin>.    Interapplication Communication
  60. AECoercion    AECoercionINIT shows how to install System level AppleEvent Coercion routines at INIT time.  You may also be interested in the coercion routines as samples of AE coercions in general.    Interapplication Communication
  61. FinderOpenSelection    This sample sends Finder 'Open Selection' events two different ways. The first, 'Send Open Selection', opens the file you select. The second,'Open Window Containing...' will open the Finder window containing the file you select.    Interapplication Communication
  62. IPCLister    A small example of how to use IPCListPorts. This sample collects and displays all the PPC/AppleEvent capable machines in your current zone and puts them in a nice list.    Interapplication Communication
  63. ODOC    This sample sends an 'odoc' event to a specified running application    Interapplication Communication
  64. SendFinderOpen    This snippet shows you how to send an OpenSelection Finder AppleEvent.    Interapplication Communication
  65. Simple HLE    Here is a simple High Level Event sample. It posts two events, then uses a filter to accept the second one. Using AppleEvents is a much better solution than using High Level Events, however...     Interapplication Communication
  66. SmallDaemon    This is a minimal faceless background application (FBA) for System 7. Versions are provided in MPW C and MPW Pascal.    Interapplication Communication
  67. SuspendAppleEvent    A simple example of suspending and resuming an AppleEvent.    Interapplication Communication
  68. TEXTtotypeIntlCoercion    A coercion routine that seamlessly converts old-style typeChar data to typeIntlText, so you don't have to rewrite old code.    Interapplication Communication
  69. Cache Flushing    Cache.c contains code to correctly flush instruction and data caches on all Macintosh CPUs, including the Quadras.    Memory
  70. SimpleInit    This snippet demonstrates the writing of a simple init which attempts to allocate a 1 megabyte and then a 2 megabyte handle in the System heap.    Memory
  71. Switch Stack    This is a simple example of showing how to correctly switch to a private stack for interrupt-time code that requires more than a few dozen bytes of stack space. The example uses THINK C's inline assembler, so MPW users will have to either inline it, or write something similar using MPW's assembler.    Memory
  72. ADSP Chat    ADSP Chat is a sample application demonstrating the use of the AppleTalk Data Stream Protocol (ADSP).    Networking
  73. AFP C++    A C++ class that provides an interface to the Appletalk Filing Protocols (AFP) as documented in Chapter 13 of Inside AppleTalk.  Each of the classes' methods corresponds to an AFP call.    Networking
  74. AppleTalk Libraries    A set of AppleTalk librariesthat features Name Binding Protocol,  Zone Information Protocol,  AppleTalk Filing Protocol, and more    Networking
  75. ATP Demo    This sample code demonstrates how to use the AppleTalk Transaction Protocol (ATP) to send data back and forth between two machines on the network.    Networking
  76. ENET Sample    This snippet demonstrates how one can use the Ethernet routines described in Inside Macintosh volume VI.  The program demonstrates the basic use of the various Control calls to the ENET driver.     Networking
  77. Get Ethernet Address    Demonstrates both the use of the LAP Manager to get the current AppleTalk connection device and a call to EGetInfo to obtain the burned in Ethernet address.    Networking
  78. Get LAP Connection     Sample code to demonstrate use of the LAP Manager call to determine the current connection type i.e LocalTalk, EtherTalk phase 1/2, or TokenTalk phase 2.    Networking
  79. GetADEVType    Sample code to demonstrate use of the LAP Manager call to determine the current connection type i.e LocalTalk, EtherTalk phase 1/2, or TokenTalk phase 2.    Networking
  80. Neighborhood Watch    Neighborhood Watch is a MultiFinder friendly application which allows people to post public messages to the network.    Networking
  81. Talking Heads    Startup document that allow you to "talk" with others in your network.  Files can be transferred between users.    Networking
  82. TalkTool    TalkTool is an MPW tool that allows you to use several protocols over AppleTalk.  It can send DDP, ATP, and Echo packets, and you can register names, get the zone list, and view names registered in the network    Networking
  83. TCP    Includes two MPW Tools, TCPSend and TCPReceive, that demonstrate a very simple establishment of a TCP connection and sending a text string over that connection. An API library of all the MacCTB driver and DNR calls is also included.    Networking
  84. TCP Server    This client/server sample uses MacTCP to implement a simple "greeting" server.  The server opens up several listeners on kGreetingPort (1235).     Networking
  85. TCPClose    This snippet shows how to close a connection gracefully without causing errors or forcing aborts on either the local or remote end.    Networking
  86. testNBP    Test program to demonstrate case insensitivity of NBP. Two names are registered and confirmed. A lookup is performed with both lower case and upper case initial letters of the object. Also demonstrates the use of the PSetSelfSend capability.    Networking
  87. Transition Queue Watcher    This sample program demonstrates the implementation of an AppleTalk Transition Queue to demonstrate the messages which get passed when transition events take place.    Networking
  88. UDPSample    This sample illustrates how to send and receive MacTCP UDP packets, setting up a simple connectionless chat program.  Instead of an outstanding read command, an ASR is  used to inform the program there is data to be received.    Networking
  89. Zap TCP Application    This small app contains a trap patch to _ExitToShell which will search all open MacTCP connections for any connections which are allocated within the currently quitting or crashing application. Any such connection will be closed and its assocated MacTCP stream will be released.  This will prevent most of the Mac crashes associated with MacTCP networking. You can easily put this code into your MacTCP application for the same functionality.    Networking
  90. GestaltValue    GestaltValue is a binary library that allows you to add your own Gestalt selectors to the System. No source.    OS Utilities
  91. Sleep Queue Entry    This snippet demonstrates how to create a sleep queue entry under Think C.    OS Utilities
  92. TestGestalt    These sample applications show how to use Gestalt to get information on system features.    OS Utilities
  93. Dashed Lines    This sample demonstrates how to draw dashed line objects on PostScript printers. This simple example does not deal with QuickDraw printers, on which it draws solid black lines.    Printing
  94. Dashed-capped Lines    This sample demonstrates how to draw dashed line objects on PostScript printers. In this case, they are capped PostScript lines. I use round caps, which means that the ends of the lines are rounded. This simple example does not deal with QuickDraw    Printing
  95. GrayText    This sample demonstrates two methods of printing gray text. On PostScript printers it sends PostScript, on QuickDraw printers it sends Color QuickDraw calls. If a QuickDraw printer does not use a CGrafPort, the gray text comes out as black.    Printing
  96. HairLines    HairLines is an MPW 3.2 Pascal sample that demonstrates different methods of creating hairlines on printers.    Printing
  97. ImageWriter bug    This sample snippet demonstrates how to work around the 'dctb' bug in the ImageWriter II 6.1 and 7.0 drivers. This bug causes a crash when doing a style (Page Setup) dialog after setting draftBits with PrGeneral.    Printing
  98. InvertedText    This sample application gives you cool tricks for printing inverted text.    Printing
  99. IsImageWriter    This program contains a few functions for determining if an ImageWriter is connected and if so, which port it should be connected to.    Printing
  100. Offscreen region maskRgn    Takes a text string, turns it into a region and copies a bitmap to the printing grafPort through the maskRgn.  The effect is patterned text here, but any image could be showing through the text.    Printing
  101. PDlog Expand    This example shows how to add items to print dialogs. It’s essentially the code in Tech Note #95, only in C.    Printing
  102. PicCommentsTest    Here's a complete working application you can use to investigate further the interpretation of picture comments by various printer drivers under various circumstances. Read TN#91 for details.    Printing
  103. PostScriptHandleDemo    This sample demonstrates how to use the PostScriptHandle PicComment to send PostScript to PostScript printers. This is of course only useful for PostScript printers.    Printing
  104. Print multipage PICT    Takes a PICT larger than one page and "tiles" it so that it prints across the right number of sheets of paper to tape together and make a poster, like many drawing applications.     Printing
  105. Rotated Thingies    This example demonstrates how to rotate objects on PostScript printers using two methods: RotateBegin/End PicComments and TextBegin/End PicComments. PrGeneral is used to change the resolution, which throws another wrench in the works: scaling.    Printing
  106. Save Print Record    Walks you through the style and job dialogs to create a print record ready-to-print-with, and then saves it to a resource file with resource type 'YO!!' and ID 128.  The first step towards saving print records for multiple printers.     Printing
  107. Scalable PostScript PICT    Shows how you can use the PostScript clip in combination with the QuickDraw clipping region to make PostScript code that scales at run-time.  Has some limitations, but a useful technique.    Printing
  108. SetPDiMC    This MPW tool sets the “Printer Driver Is MultiFinder Compatible” flag (see “Learning to Drive” on the Developer Essentials disc).    Printing
  109. Stylemap    Yet another code illustration for the Q&A on "intrinsic styles of a PostScript font" in d e v e l o p, Summer 1991.    Printing
  110. 7.0fo    An After Dark module which displays the processes currently running on the Macintosh. Shows how to use the Process Manager and uses True Type fonts.    Processes
  111. Just Finder    Handy little application for font workers -- run this and when it's done, the only foreground process you have left is the Finder, which means you can work freely within the Fonts folder.  Shows how to kill processes safely, which isn't as easy as it looks even though we have other snippets to do this.     Processes
  112. KillEveryOneButMe    This thing shows you how to kill all the other applications running on a machine for demos, school situations, kiosks, etc. PLEASE don't abuse this.    Processes
  113. LaunchWithDoc    This is the smallest Launch application we could come up with; it launches an application with the 'odoc' (Open Documents) Apple event.    Processes
  114. LaunchWithDoc2    Document-launching sample program Loosely based on C.K. Haun's LaunchWithDoc. This snippet includes some very useful routines.     Processes
  115. Process    An MPW tool that prints information about all running processes under System 7.0.    Processes
  116. quitapps    DTS Code Snippet to quit all running applications (except yourself)    Processes
  117. SubLaunch    This sample application shows how to launch one application from another.    Processes
  118. AlternateBufferDisplay    Shows that copybits along with offscreen bitmaps can emulate alternating buffer displays at a reasonable rate.    QuickDraw
  119. Band Copying, the Sequel    Under low memory conditions, it's often necessary to draw an image by individual bands rather than to draw the entire image at once, and in most cases this method works fine unless the image requires dithering from its source to its destination.   The purpose of this app is to show the problem that may occur when copying these individual bands and to provide one possible solution.    QuickDraw
  120. CalcCMask & CalcMask    This snippet shows how to use both CalcCMask and CalcMask to create a mask given a source bitmap image. This is similar to the lasso tool found in many drawing apps.    QuickDraw
  121. ClutWind    Displays a window that shows the colors in the color table associated with the device the window is on top of.    QuickDraw
  122. CollectPictColors    This application demonstrates two methods of collecting colors used by Pict resources: the Picture Utilities package and Jon Zap's KnowsPict application. Each method gives different results.    QuickDraw
  123. Color Marquee    The proverbial marching ants, this time in red!    QuickDraw
  124. Color Picker    This app provides a quick example of how to change palette colors using the Color Picker Package. The program simply creates a palette, attaches it to a window, then calls color picker routines whenever a user clicks in the window to change a color    QuickDraw
  125. ColorizePict    Snippet to illustrate how to use CopyBits to colorize a picture.  You select a foreground and background color, and copybits colorizes the picture.    QuickDraw
  126. Compressed PICT Info    This snippet shows how to use the StdPix proc to intercept and display the compression type and depth of any compressed PICT within a PICT resource.    QuickDraw
  127. CopyBits vs. CopyMask    This snippet drag races CopyBits (using a mask region) and CopyMask (using a mask BitMap). Which do you think is faster? The results may surprise you.     QuickDraw
  128. CopybitsSpeedPalette    This program demostrates ways to increase copybits speed when using palettes.    QuickDraw
  129. CopyDeepMask    This program demonstrates the use of CopyDeepMask using 2 PICTS (one a photograph and the other a triangular mask).  It uses 2 offscreen gworlds to hold the source and mask pixmaps. CopyDeepMask is then used to create the masked image and display it in the application window.  The source, mask, and destination rectangles are all the same size in order to avoid altering pixel sizes.    QuickDraw
  130. CopyMask    Shows how CopyMask can used to fade a screen to a  lighter color.    QuickDraw
  131. DeepScreen Picker    This sample shows how to slam and center the Color Picker dialog onto the deepest device when 32 Bit QuickDraw is not available.    QuickDraw
  132. Direct Pixel Access    This snippet shows one example of how to directly change the pixel values stored in a pixel image.    QuickDraw
  133. DirectSetEntries    This sample demonstrates the use of DirectSetEntries to remap colors on a direct device.    QuickDraw
  134. DrawLine    This snippet shows how to use the QuickDraw pattern modes to invert the intersection of two colored lines.     QuickDraw
  135. DTS Groupies    This thingy groups a bunch of pictures together and takes them apart using PicComments and a QuickDraw bottleneck procedure. It's an example of how to store and retrieve custom PicComments, among other things.    QuickDraw
  136. FindFamilies    An MPW tool for examining font dependencies.  You tell FindFamilies what installed font family you're interested in, and it finds all the bitmap and outline fonts referenced by that family and tells you what other families also reference them.  Helps to check "Style-linking" so you can see that the plain variant of "MyFont Bold" is really also the bold variant of "MyFont Plain", etc.  Shows how to manipulate FOND resources and make the GetNextFOND call under System 7.1 and later.    QuickDraw
  137. GDevVideo    This code shows how to get the parameters out of GDevice records.    QuickDraw
  138. GrayishOutline    This snippet was written in reply to a developer question on how to draw the "best possible gray" across several screens of various depth (see the related Q&A in a recent  d e v e l o p   near you).    QuickDraw
  139. icl8 To cicn    This snippet converts a 'icl8' and 'ICN#' resource to a 'cicn' resource.    QuickDraw
  140. Icon Display    A Think C project that shows how to display the pure pixel data in icnX families.    QuickDraw
  141. IconDimming    This snippet shows two different ways to achieve a dimming effect on icons. The first method uses a custom color search procedure, and in the second method the RGB components of the icon's colortable entries are all dimmed before the image is copied.    QuickDraw
  142. MakeIcon    This program shows how to take any size pixmap and create any size or depth icon.    QuickDraw
  143. MakeITable    This sample application shows how to manipulate a GDevice’s inverse table.    QuickDraw
  144. Marquee    Demonstrates marching ants (the scrolling dashed lines used in a selection rectangle).    QuickDraw
  145. MyDeviceLoop    This snippet shows how to write a device loop that works under both System 7 and pre-7.0 systems. It installs a device loop procedure that searches all active screen devices, calling a drawing procedure whenever it encounters a screen that intersects the drawing region.    QuickDraw
  146. NewCCursor    This snippet shows how to create a black and white 'CURS' and a color 'crsr' cursor resource by hand.    QuickDraw
  147. Out of This GWorld    The application basically uses offscreen GWorlds and palette animation to simulate totally cool animation.    QuickDraw
  148. Palette Animation and Palette Animation Gray    These sample applications show how to animate the entries of a palette.    QuickDraw
  149. Pallete DA    This desk accesory displays the the current color table and palette information associated with it.    QuickDraw
  150. PictInfoTest    Sample to demonstrate using the Picture Utilities Package    QuickDraw
  151. PixMap2PixPat2ppat    This snippet shows how to convert a 'icl8' image to a PixMap image and then to a PixPat and then finally to a 'ppat' resource. In this example, the 'ppat' resource is saved-off into a resource file.     QuickDraw
  152. QuickDraw™ FX    A demo of every CopyBits permutation you can imagine, and then some.    QuickDraw
  153. Record•RetrievePictInfo    This snippet shows how to retrieve the colortable from multiple PICT resources using the System 7 calls RecordPictInfo and RetrievePictInfo.    QuickDraw
  154. Restore Screen Cluts    This snippet shows how to restore all the screen’s color tables back to what they normally are using two different methods.    QuickDraw
  155. Rotate Bitmap 90°    Shows a fast way to rotate bitmaps by 90 degrees.    QuickDraw
  156. RotateString    This contains the code for rotating a string 90 degrees.  Just call  RotateString and you get back a BitMap containing the rotated text.    QuickDraw
  157. Rubber Bandit    This silly little app demonstrates how to do rubber-banding in a dialog using srcXOr mode.    QuickDraw
  158. Save PICT file    Creates a QuickDraw PICT and saves it as a PICT file, including the required header of 512 bytes of nothing important.    QuickDraw
  159. ScreenDump    This snippet shows how to dump an area of the screen to a PicHandle    QuickDraw
  160. SearchProcs & Color Separation    This snippet shows how to create and install your  own custom search procedure.  In this example, the searchProc performs RGB color separation.    QuickDraw
  161. SeedCFill Example    This snippet shows how to use the SeedCFill routine.    QuickDraw
  162. Snapshot    This program demonstrates how to easily capture the main screen's desktop image into your own window.    QuickDraw
  163. TE Over Background    This sample shows how to use TextEdit over a background GWorld without those nasty white patches. The trick is to patch the bottlenecks for the port so that when TextEdit erases it just copies your bits rather than erasing.    QuickDraw
  164. Thumbnail Test    a routine to illustrate the use of copybits to generate thumbnail images    QuickDraw
  165. TickAnimate    Sample of how to use ticks to synchronize drawing to the screen.    QuickDraw
  166. TranslateRotate    This MPW Tool demonstrates the use of the Fixed and Frac types to perform simple 2D translation and rotation.    QuickDraw
  167. txRatio PICT    Creates a PICT file with a PICT containing the txRatio opcode.  Someone wanted such a picture, so this is how to create one.    QuickDraw
  168. ZoomRecter    This snippet shows how to do "Finder" style zooming between two rectangles. The boolean flag "kZoomLarger" controls the proportional direction of the zooming.    QuickDraw
  169. MovieToAIFF    This app demonstrates various ways to use Movie Export Component to export QuickTime movie files into AIFF files.    QuickTime
  170. VDTextSample    This snippet shows you how to draw and erase text to the video  preview image without causing flickers on the screen. It only   works with 'vdig's that support key color.    QuickTime
  171. 2BufRecord&Play    This application uses double buffering for both recording and playback.    Sound
  172. 2BufRecordBufferCmd    This application records the sound into two buffers and as one buffer is recording the other buffer is played using bufferCmd.    Sound
  173. 2BufRecordSndPlay    This application records the sound into two buffers and as one buffer is recording the other buffer is played using SndPlay.    Sound
  174. BufCallback    This code demonstrates the use of a call back routine with the sound manager.  All it does is play a sound with bufferCmd and then wait for the call back routine to be called.  When the routine is called the app goes back to the event loop.     Sound
  175. ClickSound    A simple sound producer.    Sound
  176. Double Buffer    This sample application shows how to play sounds using double buffering.    Sound
  177. EasyPlayRecord    This simple application demonstrates the use of SnStartFileplay at the same time as doing simple recording.  The sound file is a AIFF file.  The sound will continue to play until it is done.  When the recording is stopped the recorded sound will be played over the currently playing sound.    Sound
  178. EnableSoundThrough    This application, written in THINK Pascal, demonstrates how to enable input sound playthrough. On a Macintosh LC, enabling playthrough kills sound output; on a Macintosh si, you can play back at the same time.    Sound
  179. FreqForEverChange    This sample application shows how to play a sound and how to alter its frequency.    Sound
  180. GiMeDaPalette w/Sound    This is the original version of GiMeDaPalette with a change to make it possible to play a sound at the same time as the colors are being animated.    Sound
  181. MeterTest    This snippet demonstrates record metering through the use of SPBGetDeviceInfo() and SPBSetDeviceInfo() using the siLevelMeterOnOff selector.    Sound
  182. MultiPlay    This sample application shows how to play a sound several times in a row.    Sound
  183. RecordToFile    This app builds an AIFF file (actually it rebuilds a file which is selected).  Then it records to the file with the low level sound input calls.  When the recording is done, the code make sure that the AIFF header is correct and then plays the sound back with SndStartFilePlay.    Sound
  184. SampleRateAvail    This snippet checks for the number of sample rates available ona given Mac and lists those rates.    Sound
  185. SampleSndPlay    This sample application shows how to use SndStartFilePlay.    Sound
  186. SetSoundInput    This application demonstrates how to set the sound input rate manually in order to record at the highest possible sound quality.    Sound
  187. SndForEver    This application demonstrates how to play a 'snd ' resource that has a loop in it.    Sound
  188. SoundLevel     A simple application that meters the sound input level on the microphone using  a display much like a VCR peak-hold bar meter.    Sound
  189. 'vox ' recording    This application uses Quad buffering for both recording and playback.  The recording is done with vox recording on, so it only records sound which is at least of a certain level.    Sound
  190. WaveTable Sounds    These snippets show how to use waveTableSynth and squareWaveSynth.    Sound
  191. AE/EM trapping 1.0.1    Some MacsBug macros that allow you to break on AppleEvent and Edition Manager PACK calls.With these macros you can  type 'atb AESend' (or any other AppleEvent or Edition Manager call) and you will break when the call is made.    Testing & Debugging
  192. Audit    Audit is a small library of functions that provide an unobtrusive event tracing capability to applications, drivers, code-resources, call-backs, and any other "flavor" of Macintosh software.    Testing & Debugging
  193. BusErrorTest    Shows how to replace the 68K bus error vector—very useful for testing.    Testing & Debugging
  194. DebuggerPresence    This is a small snippet of code that can be used to to detect if macsbug is installed or not. NOTE:  This code is intended to only work with version 6.2 of macsbug.  You should refer to your Low Level Debugger's manual for more information.    Testing & Debugging
  195. Gestalt dcmd    This dcmd (debugger command for MacsBug) allows you to “use” Gestalt when you're in MacsBug. You can either ask for a particular selector (ie. evnt) or ask for all (no arguments). The response is either a string (when the selector is known) or the numeric value returned by Gestalt.    Testing & Debugging
  196. Heap Purge dcmd    Simulates TMON’s heap purge in MacsBug.    Testing & Debugging
  197. Time Manager Debugging    Add this resource file to your MacsBug  "Debugger Prefs" file and you'll have the TMTask record defined, a macro TMQ to see the time manager queue item by item, and a dcmd TM that will list all the currently installed time manager tasks.    Testing & Debugging
  198. ChangeTextStyleRec    A utility routine that can simplify the process of modifying a TextStyle record to change a font, style, or type size.    Text
  199. NamingTableAccess    NamingTableAccess is a Pascal Unit, and a small application demonstrating its usage. It helps dig out the contents of the NamingTable in a TrueType 'sfnt'    Text
  200. AddResMenu7.1    In System 7.1 AddResMenu doesn't  alphabatize anything but FONT resource names. This snippet  includes a function which you can use in your applications to get the same functionality as AddResMenu under systems before 7.1.     Toolbox
  201. BigScrolling    This snippet demonstrates the basics of creating and tracking a scroll bar.    Toolbox
  202. ColorCDEF    This working sample defproc emulates the features of the standard button control for system software 7.0 on the macintosh.    Toolbox
  203. ColoredCheckBox    This app demonstrates how to create a check box on a gray window background. The key to this is making sure that the background color for the window is set.    Toolbox
  204. CustomIcon    This snippet shows how to use custom document icons in an application. The correct procedure for doing this is to add the Icon family to the document and set bit 10 of the finder info.    Toolbox
  205. DateThing    A sample of how to write one of those date things as in the General control panel.    Toolbox
  206. Dialog popups    snippet to demonstrate the use of the system 7 popup control cdef in modal dialogs    Toolbox
  207. DialogBits    This sample application shows how to deal with many of the most commonly asked questions about the Dialog Manager.    Toolbox
  208. DragWindow INIT    DragWindow INIT is an INIT which allows you to drag a whole window under the Finder, not just the outline.    Toolbox
  209. DragWindowGrid    Shows how to write a replacement DragWindow routine that constrains the window to a grid.    Toolbox
  210. FindSysFolder    In this code, the FindSysFolder returns the real vRefNum and dirID of the current System Folder. It uses the Folder Manager, if possible, or falls back to SysEnvirons.    Toolbox
  211. GetDragHiliteColor    This shows how to obtain the color that the Drag Manager uses to hilite regions when ShowDragHilite is called. Please note this is only how it's done presently.  Since it is undocumented it can and will change in the future.     Toolbox
  212. GridWindowGrow    This snippet shows how to grow a window constrained to a grid (i.e. only allow a window to grow or shrink by 30 pixels, or whatever).    Toolbox
  213. HideMenuBar    This snippet shows how to hide the menu bar by simply creating a window with a visRgn that includes the entire main screen's gray region and its menu bar.    Toolbox
  214. Icon play    snippet to demonstrate the use of the system 7 icon utilities and the system 7 popup control cdef in a program using modal dialogs    Toolbox
  215. IconUtilCheck    This snippet shows how to determine whether the Icon Utilities are available.    Toolbox
  216. ItemHider    Two sample applications, in both MPW and Turbo Pascal® versions, show how to hide editText fields in a dialog.    Toolbox
  217. jGNEFilter    This snippet is a sample GetNextEvent filter which uses the JGNEFilter mechanism described in Tech Note #85 "GetNextEvent: Blinking Apple Menu".    Toolbox
  218. kcapApp    Demonstration keyboard drawing from KCAP resource. The DrawKeyCaps function draws the key caps, given a set of  modifiers (in the high byte of the modifier short parameter) and KCHR and KCAP resource IDs, using the current pen in  the current GrafPort .     Toolbox
  219. KeyMapTest    Shows how to interpret the results of GetKeys.    Toolbox
  220. ListInDialog    A snippet that shows how to put a List Manager list in a dialog. It's easy, just create the list right after you create the dialog, then call LUpdate and LClick in a dialog filter to respond to user events.    Toolbox
  221. MDEF.Sample    An MDEF written in Pascal that supports rez MENU templates and allows you to request the use of the Shift-Command symbol (made famous by our friends to the North).    Toolbox
  222. MenuHook/MBarHook exposed    Installs routines called when a menu is pulled down and when the mouse is down in the menu bar.  Inverts the region underneath the menu so you can graphically see the results, as well as flashes status indicators.  Can mess up your desktop (but only visually).    Toolbox
  223. Modal TextEdit    This snippet shows the steps necessary to implement a scrolling, editable text field in a modal dialog.    Toolbox
  224. Modeless Dialog Sample    A sample application showing how to implement a modeless dialog  with a couple of controls. Compiles with the PowerPC Universal interfaces for both 68K and PowerPC applications, which you can get from a Developer CD or AppleLink.     Toolbox
  225. MovableModal    A small sample showing one way of implementing Movable Modal dialogs in a 7.0 or later application.    Toolbox
  226. NoResDialog    OK, so despite all your planning, you still think you may need to create dialogs on the fly , without having any resource templates available for the DITL. This small sample creates a dialog with an OK button witha border around it, all with in-memory data structures. Just look at the function NoResDialog(...), and you'll see.    Toolbox
  227. NoSound    This small app, placed in your Startup Items folder,  quiets the startup sound by installing a Shutdown procedure that saves the current volume setting and sets the volume to 1. On the following startup, the saved setting is restored, and the Shutdown procedure is re-installed for next time. And so on...    Toolbox
  228. Notification Hacks    A collection of sick Notification Manager hacks.    Toolbox
  229. OpenWindow    Shows basic initialization calls and how to open a window for drawing.    Toolbox
  230. OtherResInfo-MungeDeamon    This sample demonstrates how to use a background-only application and AppleEvents to safely open and query another application's (or other file's) resource fork.     Toolbox
  231. Password    This is a simple demo of three ways to implement a password dialog, where characters typed are not drawn; instead, anonymous characters such as bullets are drawn, keeping the password secure.    Toolbox
  232. PBAllocate    This MPW tool shows how to work around a bug in PBAllocate.    Toolbox
  233. PowerMacOr68K    This snippet shows how to determine whether you are running on a Power Macintosh or on a 680x0 Macintosh.  It also provides a method for determine exactly which type of processor is running. This works around an off-by-one error with gestaltNativeCPUType.    Toolbox
  234. Prefs    This Think C application displays a sample preferences dialog containing edit text, radio buttons, and a file selection button, and demonstrates storage of the item settings in a preferences file.    Toolbox
  235. readLocation    This snippet shows how to retrieve the Map control panel settings for longitude and latitude and the time offset from GMT    Toolbox
  236. Reinstallable    Usually, when an INIT patches a trap, changing the INIT requires reinstalling the INIT in the Extensions folder and rebooting. This snippet demonstrates a technique which allows new INIT code to replace most of the old code without the developer having to reboot.     Toolbox
  237. ReKeyTrans    Shows how to use the Script Manager and KCHRs to call KeyTrans.    Toolbox
  238. RequiredFinderColors    Under system 7, the finder requies certain colors for the desktop icons to be displayed in their color versions. This snippet shows which colors are needed in the system color table.     Toolbox
  239. Scrap Parsing    An example of how to parse the scrap in memory.    Toolbox
  240. SetIndString    This C function takes the same parameters as GetIndString but does the opposite: it sets a particular STR# string to the string that’s passed in.    Toolbox
  241. ShadingWinds    This little application includes code to allow you to detect whether or not a window is "rolled up" by WindowShade.    Toolbox
  242. SICN LDEF    This LDEF displays small icons to the left of text in a list.    Toolbox
  243. SignatureToApp    A function that finds an application on any mounted (non-floppy) disk given its 4-character signature. It will also launch or activate the application if told to.    Toolbox
  244. Splasher    A very simple application that displays a "modal" window that goes away as soon as you click the mouse or press a key.  This is how many splash screens behave -- but as long as the window is displayed, the Process Manager won't switch your application from being frontmost.    Toolbox
  245. Sys7 popUpCDEF    A simple example of using the PopupCDEF available in System 7 and later.    Toolbox
  246. TwoColumn LDEF    This LDEF looks for a comma in the text of each cell and draws the text that follows the comma half-way across the cell.     Toolbox
  247. VertTest    This sample application shows how to get information from a 'vers' resource (see Technical Note #189).    Toolbox
  248. WDEFColorSample    This sample shows how to obtain the colors that embellish System 7 window.     Toolbox
  249. WDEFPatch    This snippet shows how you can add a simple extra part to an existing WDEF and be able to do hit testing on the part via FindWindow().  The extra part in this case is on the right side of the title bar, just to the left of where the zoombox would be.  When hit, it inverts the window.    Toolbox
  250. WindowColors    This application displays the default window colors stored in the System's 'wctb' resource.  Note that this app is 7.0 only, since it only recognizes the 7.0 version of the resource.    Toolbox
  251. ZoomWindow    Demonstrates how to properly zoom a window. It gives attractive results with most WDEFs because it uses the window’s structure region rather than just its portRect.    Toolbox
  252.